<template>
  <div id="fucai3dPage" class="view">
    <game-header :caipiaoTerm='caipiaoTermCon' :caipiaoName='caipiaoName'></game-header>
    <el-tabs  type="border-card" v-model="activeName" @tab-click='changeTab' >
      <el-tab-pane v-for="item in gameArr" :key="item.order" :label="item.backup1" :name="item.order">
        <el-tabs  v-model="activeName2">
          <el-tab-pane v-for="p in item.children" :key="p.order2" :label="p.name" :name="p.order2">
          	<component :is="p.myTab" :caipiaoTerm='caipiaoTermCon' :childArr = "p"></component>
          </el-tab-pane>
        </el-tabs>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
  import header from '../../gamesub/header'
  import dxds from './play/dxds'
  import bdw from './play/bdw'
  import erma from './play/erma'
  import em from './play/em'
  import dwd from './play/dwd'
  import zhixuan from './play/zhixuan'
  import zuxuan from './play/zuxuan'
  export default {
    data () {
      return {
      	caipiaoName: '福彩3D',
        activeName: '0',
        activeName2: '0',
        caipiaoTerm: 1,
        caipiaoTermCon: 2123123123,
        ticketId: 33,
        gameArr: []
      }
    },
    created () {
    	let arr = this.$store.state.allGameList
    	arr.forEach(item => {
    		if(item.ticketId === this.ticketId) {
    			this.gameArr = item.list
    		}
    	})
    	console.log(this.gameArr)
    },
    methods: {
    	changeTab () {
    		this.activeName2 = "0"
    	}
    },
    components: {
      'game-header': header,
      'my-bdw': bdw,
      'my-dxds': dxds,
      'my-erma': erma,
      'my-dwd': dwd,
      'my-zuxuan': zuxuan,
      'my-zhixuan': zhixuan,
      'my-em': em
    }
  }
</script>

<style lang="less">
  #fucai3dPage{
    /*border:1px solid #ccc;*/
    .el-tabs--border-card>.el-tabs__header .el-tabs__item.is-active{
      background-color: #f13131;
      color: white;
    }
    .content {
      background-color: #fff;
      border-bottom: 1px solid #ddd;
    }

  }
</style>
